import {fileUpload, http,} from './base'
const url = ''
/**
 * code 登录
 * @param {*} params
 * @returns
 */
export const loginByCode = (params = {}) => {
	return http.post(url + 'loginByCode', {
		...params,
	}, {
		isReturnNativeResponseByError: true,  // 获取错误信息并禁止自动跳转
	})
}

// 根据token进行登录
export const loginByToken = (params = {}) => {
	return http.post(url + 'loginByToken', params,  {
		isReturnNativeResponseByError: true, // 获取错误信息并禁止自动跳转
	})
}
/**
 * 普通接口
 * @param {*} params
 * @returns
 */
export const getApi = (params = {}) => {
	return http.get(url + 'loginByCode', {
		params,
		// isReturnNativeResponseByError: true, // 获取错误信息并禁止自动跳转
	})
}

/**
 * 获取图片
 * @param {*} params
 * @returns
 */
export const getImg = (params = {}) => {
	return http.get(url + 'getImg', {
		params,
		isReturnNativeResponse: true, // 获取图片需要返回原生的response
	})
}
/**
 * 图片上传接口
 * @param {*} params
 * @returns
 */
export const upload = (params = {}) => {
	return fileUpload(url + 'upload',  params)
}
